package com.epam.cdp.jpa.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@Entity
public class BookCopy extends BaseEntity {

    private static final long serialVersionUID = 1L;
    
    @ManyToOne(targetEntity = Book.class, cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH})
    @JoinColumn(nullable = false)
    private Book book;

    private boolean avaiable = true;
}
